/*
* 图层控制和查询相关定义
* created by zfy
* modifyed by clj 20180814
* */
/*行政区划代码长度与图层名对应关系*/
let adminLayer = {
  1:'国界',
  2:'省域',//省级行政区划图层名称
  4:'地市域',//市级行政区划图层名称
  6:'县域',//县级行政区划图层名称
  9:'乡镇域',//乡镇级行政区划图层名称
  12:'村域',//村级行政区划图层名称
}

let layer_src_common={
      "gjId":"国界",//国界ID
      "gj":"dt_gj",//国界
      "gj_ptId":"中国",//国界点ID
      "gj_pt":"dt_gj_pt",//国界点


      "syId":"省域",//省域ID
      "sy":"dt_sy",//省域
      "sy_ptId":"省域",//省域点ID
      "sy_pt":"dt_sy_pt",//省域点

      "shId":"省会",//省会ID
      "sh":"dt_sh_pt",//省会

      "dsyId":"地市域",//地市域ID
      "dsy":"dt_dsy",//地市域
      "dsy_ptId":"地市点",//地市域点ID
      "dsy_pt":"dt_dsy_pt",//地市域点

      "xyId":"县域",//县域ID
      "xy":"dt_xy",//县域
      "xy_ptId":"县点",//县域点ID
      "xy_pt":"dt_xy_pt",//县域点

      "xzyId":"乡镇域",//乡镇域ID
      "xzy":"dt_xzy",//乡镇域
      "xzy_ptId":"乡镇点",//乡镇域点ID
      "xzy_pt":"dt_xzy_pt",//乡镇域点

      "cyId":"村域",//村域ID
      "cy":"dt_cy",//村域
      "cy_ptId":"村点",//村域点ID
      "cy_pt":"dt_cy_pt",//村域点

      "satelliteId":"卫星影像",//卫星影像ID
      "satellite":"satellite",//卫星影像

      "ckLayerId":"现场采集",//查勘查询图层ID

       "ckdkLayerId":"查勘地块"/*查勘地块ID*/,
       "ckbzLayerId":"查勘标注"/*查勘标注ID*/,

      "cbId":'承保地块',
      "cbSrc":'dt_cbdk',
      "ybId":'验标地块',
      "ybSrc":'dt_cbdk',

      "ybmark":"验标标注",
      "cbmark":"承保标注",


      "zzdkId":"种植地块",//种植地块ID
      "zzdk":"dt_zzdk",//种植地块
      "zzdkbzId":"种植地块标注",//种植地块标注ID
      "zzdkbz":"dt_zzdk_pt",//种植地块标注

      "nhId":"农户",//农户ID
      "nh":"dt_cknh",//农户


        "zzjdId":"种植结构",
        "zzjgId":"种植结构",
        "zzjgSrcId":"dt_zzjg",/*种植结构srcId*/

      "pkhId":"贫困户",//贫困户ID
      "pkh":"dt_cknh",//贫困户

  "nqxxId": "农情信息",
  "nqxx": "dt_nqxx",
  "nqxxbzId": "农情信息标注",
  "nqxxbz": "dt_nqxx",
}




//定义下钻图层配置
let layer_Drilldown=[
  {
    "levelName":"全国",
    "level":0,
    "layerId":"国界",
    "sourceId":"dt_gj",
    "sourceLayer":"dt_gj",
    "ptLayerId":"中国",
    "sourceId_pt":"dt_gj_pt",
    "sourceLayer_pt":"dt_gj_pt",
    "minzoom":0,
    "maxzoom":3.5,
    "layer_ht":"",
    "layer_fill":"",
    "layer_bk":""
  },
  {
    "levelName":"省",
    "level":1,
    "layerId":"省域",
    "sourceId":"dt_sy",
    "sourceLayer":"dt_sy",
    "sourceId_pt":"dt_sy_pt",
    "sourceLayer_pt":"dt_sy_pt",
    "minzoom":3,
    "maxzoom":6,/*把省写低一个级别，正常是7，为了省域的下钻图层和地市域的下钻图层不重叠*/
    "layer_ht":"dt_sy_ht",
    "layer_fill":"dt_sy_fill",
    "layer_bk":"dt_sy_bk"
  },
  {
    "levelName":"地市",
    "level":2,
    "layerId":"地市域",
    "sourceId":"dt_dsy",
    "sourceLayer":"dt_dsy",
    "sourceId_pt":"dt_dsy_pt",
    "sourceLayer_pt":"dt_dsy_pt",
    "minzoom":6,
    "maxzoom":8,
    "layer_ht":"dt_dsy_ht",
    "layer_fill":"dt_dsy_fill",
    "layer_bk":"dt_dsy_bk"
  },
  {
    "levelName":"县",
    "level":3,
    "layerId":"县域",
    "sourceId":"dt_xy",
    "sourceLayer":"dt_xy",
    "sourceId_pt":"dt_xy_pt",
    "sourceLayer_pt":"dt_xy_pt",
    "minzoom":8,
    "maxzoom":10,
    "layer_ht":"dt_xy_ht",
    "layer_fill":"dt_xy_fill",
    "layer_bk":"dt_xy_bk"
  },
  {
    "levelName":"乡镇",
    "level":4,
    "layerId":"乡镇域",
    "sourceId":"dt_xzy",
    "sourceLayer":"dt_xzy",
    "sourceId_pt":"dt_xzy_pt",
    "sourceLayer_pt":"dt_xzy_pt",
    "minzoom":10,
    "maxzoom":12,
    "layer_ht":"dt_xzy_ht",
    "layer_fill":"dt_xzy_fill",
    "layer_bk":"dt_xzy_bk"
  },
  {
    "levelName":"村",
    "level":5,
    "layerId":"村域",
    "sourceId":"dt_cy",
    "sourceLayer":"dt_cy",
    "sourceId_pt":"dt_cy_pt",
    "sourceLayer_pt":"dt_cy_pt",
    "minzoom":12,
    "maxzoom":18,
    "layer_ht":"dt_cy_ht",
    "layer_fill":"dt_cy_fill",
    "layer_bk":"dt_cy_bk"
  }
]
/* 20180926 add by gf 在layer_Drilldown 中添加地块图层信息 */
layer_Drilldown.__proto__.dk = {
  "levelName":"地块",
  "level":6,
  "layerId":"地块域",
  "sourceId":"dt_zzdk",
  "sourceLayer":"dt_zzdk",
  "sourceId_pt":"",
  "sourceLayer_pt":"",
  "minzoom":13,
  "maxzoom":18,
  "layer_ht":"",
  "layer_fill":"",
  "layer_bk":""
}

//查询图层及优先级别配置
let query_layer_setting =
  [
    {
      "source":"dt_cknh",
      "layerid":"农户",
      "priority":10,
      "qMode":1,  //1表示查图层属性，2表示挂接其他查询信息卡
    },
    {
      "source": "dt_zzdk",
      "layerid": "种植地块",
      "priority": 5,
      "qMode":2,  //1表示查图层属性，2表示挂接其他查询信息卡
    },
    {
      "source": "dt_zzdk",
      "layerid": "isearch_zzdk",
      "priority": 15,
      "qMode":2,  //1表示查图层属性，2表示挂接其他查询信息卡
    },
    {
      "source":"dt_zzjg",
      "layerid":"种植结构",
      "priority":6,
      "qMode":1,  //1表示查图层属性，2表示挂接其他查询信息卡
    },
  ]


let legend_layer_setting =
  [
    {
      "group":"种植地块",
      "layers":["种植地块","种植标注"],
    },
    {
      "group":"参考农户",
      "layers":["农户","贫困户"]
    },
    {
      "group":"种植结构",
      "layers":["种植结构"],
      "labels":[
        { "label":"冬小麦",
          "layers":["种植结构"],
          "field":"zwdm",
          "filter":["07"]
        },
        { "label":"油菜",
          "layers":["种植结构"],
          "field":"zwdm",
          "filter":["06"]
        },
        { "label":"水稻",
          "layers":["种植结构"],
          "field":"zwdm",
          "filter":["03"]
        },
        { "label":"花生",
          "layers":["种植结构"],
          "field":"zwdm",
          "filter":["01"]
        },
        { "label":"大豆",
          "layers":["种植结构"],
          "field":"zwdm",
          "filter":["02"]
        },
        { "label":"玉米",
          "layers":["种植结构"],
          "field":"zwdm",
          "filter":["16"]
        }
      ]
    },
    {
      "group":"承保验标",
      "layers":["承保地块","承保标注","验标地块","验标标注"],
      "labels":[
        { "label":"冬小麦",
          "layers1":["承保地块","承保标注"],
          "field1":"zwdm",
          "filter1":["07"],
          "layers2":["验标地块","验标标注"],
          "field2":"zwdm",
          "filter2":["07"]
        },
        { "label":"油菜",
          "layers1":["承保地块","承保标注"],
          "field1":"zwdm",
          "filter1":["06"],
          "layers2":["验标地块","验标标注"],
          "field2":"zwdm",
          "filter2":["06"]
        },
        {
          "label": "水稻",
          "layers1":["承保地块","承保标注"],
          "field1":"zwdm",
          "filter1": ["03"],
          "layers2":["验标地块","验标标注"],
          "field2":"zwdm",
          "filter2": ["03"]
        },
        { "label":"花生",
          "layers1":["承保地块","承保标注"],
          "field1":"zwdm",
          "filter1":["01"],
          "layers2":["验标地块","验标标注"],
          "field2":"zwdm",
          "filter2":["01"]
        },
        { "label":"大豆",
          "layers1":["承保地块","承保标注"],
          "field1":"zwdm",
          "filter1":["02"],
          "layers2":["验标地块","验标标注"],
          "field2":"zwdm",
          "filter2":["02"]
        },
        { "label":"玉米",
          "layers1":["承保地块","承保标注"],
          "field1":"zwdm",
          "filter1":["16"],
          "layers2":["验标地块","验标标注"],
          "field2":"zwdm",
          "filter2":["16"]
        },
        { "label":"其他",
          "layers1":["承保地块","承保标注"],
          "field1":"zwdm",
          "filter1":["04","10","11","14","17"],
          "layers2":["验标地块","验标标注"],
          "field2":"zwdm",
          "filter2":["04","10","11","14","17"]
        }
      ]
    }
  ];
/*查勘图层id，查勘模块将给该配置里的查勘图层配色*/
let surveyLayer = [
  "20180819洪灾"
]
//其他
//"04" 棉花
//"10" 果树
//"11" 林木
//"14" 蔬菜
//"17" 核桃

//承保季过滤图层
let insSeasonLayer=['种植结构']

export default {
  layer_src_common:layer_src_common,
  query_layer_setting:query_layer_setting,
  legend_layer_setting:legend_layer_setting,
  layer_Drilldown:layer_Drilldown,
  adminLayer:adminLayer,
  surveyLayer:surveyLayer,
  insSeasonLayer:insSeasonLayer
}

